package data
{
	import control.manager.MapManager;
	
	import flash.geom.Point;

	/**
	 * 怪物数据 
	 * @author leo
	 * 
	 */	
	public class MonsterData
	{
		/**
		 * 怪物id 
		 */		
		public var monsterID :String;
		/**
		 * 怪物名 
		 */		
		public var roleName :String;
		/**
		 * 怪物血量 
		 */		
		public var monsterHP :int;
		/**
		 * 怪物攻击力 
		 */		
		public var monsterATT :int;
		/**
		 * 怪物速度 
		 */		
		public var monsterSpeed :int;
		/**
		 * 怪物出现的点 
		 */		
		public var monsterAppearArea :Array;
		/**
		 * 角色图片链接 
		 */		
		public var roleURL :String;
		/**
		 * 角色类型 
		 */		
		public var roleType :String;
		/**
		 * 角色动作数组 
		 */		
		public var action :Array;
		/**
		 * 怪物数量 
		 */		
		public var monsterNumber :int;
		public function MonsterData()
		{
		}
		
		/**
		 * 创建怪物数据列表 
		 * @param xmlList
		 * @return 
		 * 
		 */		
		public static function createMonsterDataList(xmlList :XMLList):Vector.<MonsterData>
		{
			var monsterDataList :Vector.<MonsterData> = new Vector.<MonsterData>();
			if(xmlList)
			{
				for each(var xml :XML in xmlList.item)
				{
					var monsterData :MonsterData = new MonsterData();
					monsterData.action = MapManager.instance.string2ActionAry(xml.@action);
					monsterData.monsterAppearArea = MapManager.instance.string2PointAry(xml.@monsterAppearArea);
					monsterData.monsterATT = xml.@monsterATT;
					monsterData.monsterHP = xml.@monsterHP;
					monsterData.monsterID = xml.@monsterID;
					monsterData.roleName = xml.@roleName;
					monsterData.monsterSpeed = xml.@monsterSpeed;
					monsterData.roleType = xml.@roleType;
					monsterData.roleURL = xml.@roleURL;
					monsterData.monsterNumber = xml.@monsterNumber;
					monsterDataList.push(monsterData);
				}
			}
			return monsterDataList;
		}
	}
}